package cn.edu.scau.cmi.xianjiehua.simpleFactory;

import cn.edu.scau.cmi.xianjiehua.domain.CarDamage;
import cn.edu.scau.cmi.xianjiehua.domain.Casualties;
import cn.edu.scau.cmi.xianjiehua.domain.DriverInjured;
import cn.edu.scau.cmi.xianjiehua.domain.Insurance;
import cn.edu.scau.cmi.xianjiehua.domain.MultipleAccidents;

public class SimpleFactory {
	public static final String CAR_DAMAGE = "汽车损坏";
	public static final String CASUALTIES = "人员伤亡";
	public static final String DIRVER_INJURED = "司机受伤";
	public static final String MULTIPLE_ACCIDENTS = "多种事故";
	public static Insurance getInstance(String type) {
		if(type.equals(DIRVER_INJURED)) {
			return new DriverInjured();
		}else if(type.equals(CAR_DAMAGE)){
			return new CarDamage();
		}else if (type.equals(CASUALTIES)){
			return new Casualties();
		}else if(type.equals(MULTIPLE_ACCIDENTS)) {
			return new MultipleAccidents();
		}
		return null;
	}

}
